perm filename TMP.TEX[WEB,ALS] blob
sn#750544 filedate 1984-04-13 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 \magnification=1200 \parskip 10pt plus 1pt \parindent 0pt
C00070 ENDMK
C⊗;
\magnification=1200 \parskip 10pt plus 1pt \parindent 0pt
{\bf 1) Introduction}
This is not a lecture in the ordinary sense, but an opportunity for me to
talk to you about computers much as I would talk to you in ordinary
conversation. For this to work, you will have to ask me questions. Dave
Taxis has gone to a lot of trouble to fix up the hall tonight so that your
questions can be heard by me and by the rest of you in the room so do not
dissapoint him and me by not interrupting me from time to time with
questions. Just hold up your hand and either I will see you or Dave will
rush over with the mike so that you can be heard.
What I will say by way of introduction will be largely anecdotal. There
is a reaon for this. As many of you know, I have just returned from a six
weeks trip to south-east Asia. Before I left, I was too busy at Stanford
to thing this far ahead, while I was away I was immersed in quite a different
culture and since my return I have been suffering from jet lag.
So as a matter of expediency, I am rather forced to resort to personal
reminiscences.
But in a way, I rather like an excuse to reminisce. You know, of course,
that there three ways that a people reveal that they are getting old. In
the first place they like to reminisce, and I plead guilty to this charge.
The second way is that they forget things. And the third way is, well, I
seem to have forgotten what the third way is.
There is, however, a sound reason for making my talk anecdotal and
personal, quite apart from expediency. It happens that this is the third
time that I have talked to many of you on computing and I do not want to
bore you by repeating myself. After my last talk, I had the exprerience
of having several people tell me that they had enjoyed my talk but that
they had not understood a word of what I said. Now it is hard for me to
believe that it was impossible for them to understand me, after all I was
speaking English What these people really meant was that they could not by
then recall what it was that I had said because it was all too far removed
from their experience.
I do not want this to happen a second time and perhaps if I tell you
something about my personal involvement with the development of computers
and computing and about the people with whom I dealt, this may give you
the hooks needed for you to remember what I have said.
But let me first state catagorically that you should be able to
understandble most of what I am going to say, even without such hooks, if
you will only try. Computers are really not all that hard to understand
as long as you do not get involved with the gruesome details.
Will it help if I tell you that the basic principles of the modern digital
computer were first suggested by Charles Babbage in 1833, yes I said 1833
and not 1933. Furthermore, the best written explanation of Babbage's ideas
was written in 1844 by a young woman Lady Lovelace, the daughter of Lord
Byron the poet. If Lady Lovelace could understand and explain the
principles of the modern digital computer in 1844, more than 100 years
before the first successful computer was actually built, then there is
really no excuse for you not to understand something about computers and
what makes them tick, if only you decide that you can and will understand
them.
But to get on with my story,---
My own envolvment with mechanical computational aids began in 1924, when,
I entered MIT after working a year at the General Electric Co. in Lynn and
was assigned to work with Vanenar Bush, who later attained fame as the
director of much of the war time effort effort on radar during the second
world war. Bush, at the time was in the early stages of developing a
revolutionary analog computing device which became known as the Bush Differential
Analyser. This started out as an electrical device involving an
unconventional application of an electric meter, the kind that measures
the amount of electricity that one uses, but was evolving into an entirely
mechanical device.
Incidentally, Mrs Kear's late husband was one of the team working on the
Differential Analyser.
This device did yeoman service during the war for the
computation of so-called ballistic tables, these being the tables that
were used to tell people how much to elevate a long range gun to
compensate for the parabolic path that the projectile actually followed.
My particular assignment in 1924 was to devise a technique to increase the
accuracy of such calculations to the extent nesessary. I later was to
have the satisfaction of seeing the method that I devised used during the
war for actual work although it was never entirely satisfactory.
I then left the field of computing to become a vacuum tube scientist at
the Bell Telephone Laboratories. as you have been told, and did not get
back into computer work until 1947. In the meantime a young Lieutenant at
the Aberdeen proving ground by the name of Herman Goldstine had become
dissatisfied with the accuracy then being obtained using my computational
method on thush differential Analysers that they were then using and
persuaded the Navy to support the work that was then being done by
Mauchley and Eckert, at University of Pennsilvania. So there is a
certain irony in the fact that it was the failure of my own work of the 20's to meet
the needs of the 40's that resulted in support being given to
the work that led to the development of the very first modern digital
computer.
There is also irony in the fact that Mouchley and Eckert were quite
unaware of some much earlier work done by Charles Babbage in England as
early as 1833, yes, I said 1833 and not 1933. As a matter of fact the
machine developed by Mauchley and Eckert did not possess one essential
feature that is now the hallmark of all modern digital computers and
interestingly enough Babbage knew of this feature and proposed to have it
in the machine that he tried to build. So it seems that I should tell you
a bit about Charles Babbage and the equally important contributions of
Lady Lovelace, the daughter of Lord Byron the poet.
{\bf Early History of Computing}
Perhaps I should go back even earlier and tell you a bit about the history
of computing. The art of computing actually preceeds the art of writing,
in fact, there is reason to believe that the need to record the results of
computations was the primary reason for the invention of writing. The
earliest written ``documents'' that have come down to us were made by the
Sumerians about 5000 years ago. These were primitive books of accounts.
Interestingly enough one of the first non-quantitative records contains a
lament for the good old days and a statement that the world is going to
the dogs because children no longer obey their parents.
To quote another example, the Egyptions undoubtedly developed their skill
in writing because of their need for permanent records of land holdings so
that boundry lines could be reestablished after the annual flooding of the
Nile. The preservation of historical and cultural information could be
left to oral transmittion, but when it came to settling disputed beetween
adjacent land owners, nothing took the place of written records.
It is also of interest to note that all of the records written on clay
tablets by the Minoans in the language known as Linear B, certainly before
1470 B.C. were bookkeeping accounts.
Writing can be looked upon as a mechanical means of supplimenting man's
memory. Similarly, there has been along history of attempts to make
mechanical devices to suppliment and replace man's ability to do
arithmetic.
Perhaps the earliest device that has survived to this day is the abacus.
I have one here. Actually, the abacus is really a memory device to store
the intermediate states during a calculation rather than a computing
device, per se, but it beats counting on your fingers.
I will not take the time to trace the history of compution during the
middle ages, but perhaps I should mention Pascal and Leibnitz in the 17th
century who developed early forms of calculators besides making many
fundamental comtributions to mathematical theory.
We come now to the early 18th century and to a most remarkable man Charles
Babbage and an equally remarkable woman, Lady Lovelace. Babbage first
proposed a computing device that he call his Difference Engine and he
devoted several years to its development. In 1833, while work on his
Difference Engine was temporarily at a stand-still for lack of funds,
Babbage conceived the idea of his Analytical Engine, a machine that
embodied most of the basic ideas that still are the hall-mark of the
modern digital computer. It will pay us to stop for a moment and consider
these basic ideas.
{\bf The Four Parts of a Computer}
Babbage's analytical engine and the modern digital computer have four
parts. Let me enumerate them.
In the first place there must be an input mechanism that can be used to
enter information into the machine. Babbage proposed to use the punched
card that Jacquard had just invented and used to control the pattern
produced by an automatic loom. The first digital computers also used
punch cards for input although today all modern computers use an ordinary
typewriter keyboard, slightly modified, usually with a number of
additional keys to make it easier to enter numerical information and few
special control keys that are used to distinguish between the data that is
being typed in and typed instructions to the computer as to how to process
these data. An equally important form of input, at least for the personal
or home computer, is the so-called floppy disk. I have one of these here.
The floppy disk can be used both as an input device to tell the computer
what to do and as an storage device to save programs and data that you
have accumulated.
Then there must be some form of output device that the computer uses to
report back to the user. The modern computer uses two and sometimes three
diferent devices for this purpose. The first of these is a TV screen that
is used to comunicate directly with the user. to show what is being typed,
to ask for specific information and to signal the completion of the
requested computations. The second output device is a printer of some
sort that will produce a printed record of the desired output. The floppy
disk can also be used as an output device both to allow a machine readable
record to be kept of the results of some calculation so that these results
can be reentered into the computer at some later date, and to allow the
output results to be transfered to another machine.
A third equally important device is some form of internal storage to be
used to store information temporarily during the course of the
calculation. In popular language this storage device is call the computer
memory. Babbage called this part of his machine the store.
Calling the store a memory carries an anthropomorphic implication that is
quite unwarrented and that confuses the beginner. It is true that the
computer uses its memory to store for ready access the instructions that
it reads from the floppy disk, the intermediate results that it gets
during a calculation etc. much as a person uses his or her memory to
temporarily store a number looked up in a phone book. One must not go the
next step and ascribe human attributes to the computer. The computer is
still an inanimate machine and it can only do what it is told to do.
In principle, the floppy disk could be used for storing intermediate
results but this would slow the computer down beyond all reason since the
writing and reading of information on the disk takes a very much longer
time than does the writing and reading of some internal device.
We come not to the final part of the computer and this is part of the
machine that does the actual adding, subtracting, multiplying, and
dividing. Babbage called this part of his machine the ``mill'', on large
computers it is called the ``CPU'', standing for ``central processing
unit''. This part of the computer also performs yet another function and
it is the ability to perform this additional function that sets the
computer apart from a glorified calculator.
That's all there is to a computer, an input devise, a output device, a
memory and a caculating device that is capable of making rudimentary
decisions based on whether or not one given number is larger than a second
given number.
Perhaps I can best explain this final function by an example. Since it is
that time of the year, let's consider the task of computing one's income
tax. Most of the time the calculations are quite straight forward.
However in several places you are asked to compare two values and to do
something different depending upon the results of this comparison. That
is, a decision has to be made and a different action taken basen on the
results of this decision. Now this is something quite outside of the
capabilities of a pocket calculator. To continue with the income tax
example, on schedule A line 5 one is told to write the total figure for
one's medical expenses and on line 6 one is told to write 5\% of line 33
from form 1040. Now if the value value on line 5 is greater than the value
on line 6 then one is to write the difference on line 7 otherwise one is
to write zero on this line. Making decisions of this sort is the unique
feature that makes the digital computer something more than a pocket
calculator and is the one feature that is most responsible for its wide
spread use.
Babbage was fully aware of the need for this capability and he proposed to
have it in his Analyticl Engine. It is surprising therefore to note that
the first two large machines, the INIAC and the Harvard Mark 1 did not
posess this feature. Strictly speaking, neither of these machines were
computers although they were loosly so called.
So let me renumerate, there are four parts to a computer, a) an input
device (or devices), b) an output device (or devices), c) an internal
memory for storing both the data and a sequence of instructions, and d)
and a calculating mechanism that is capable of following a set of
instructions and of choosing between two different courses through this
set of instructions based on a comparisom between two values that may be
the result of previous calculations.
I mentioned Lady Lovelace earlier and it was from the writings of Lady
Lovelace that we learned about the basic principled of Babbage's
Analytical Endine. If a young lady educated in Victorian England could
understand the principles of the not yet developed modern digital computer
then I don't believe that any of you should have any trouble.
To be more specific in terms of the physical devices that you can see, if
you buy a small personal computer you will get a device with a keyboard,
a TV screen and a printer and there will be one and sometimes two or more
slots into which one can insert floppy disks. Unseen, there will also be
an internal memory and a central processing unit. Along with these
devices, you will get a number of floppy disks that contain prewritten
programs that will ensble you to do quite a number of rather standard
things without learning anything about to mystifying art of programming.
{\bf Understanding Programming}
But now to get back to my chronicle. My next brush with computers came in
1946 after I had moved to the University of Illinois. I had, of course,
followed the limited amount of work on computing devices that had been
done at the Bell Telephone labs. and I had learned all I could about the
INIAC as the Mauchley Eckert machine was called.
By this time John von Nuemann who had worked with Mauckley and Eckart and
Hermine Goldstine had joined forces with several other pioneers and moved
to the Institute of Advanced Physics at Princeton and were busily at work
designing a truely complete digital computer, and there were quite a
number of small companies that had jumped on the band wagon and were
busily designing and building computers.
While at the Bell Labs. I had not felt the need to have a digital computer
for my work on vacuum tubes as we ad a staff of girls who did coputing for
me using ordinary desk calculators. At Illinois, the situation was
different and I had to do my own calculating. So I decided first that w
long on promices but short on performance, we decided to build our own.
Now I am going to tell you something about programming. I do not expect
you to understand in detail how to write a program as a result of my talk,
but I do expect you to have a litle better appreciation of what it is all
about. I am going to try a new tactic, instead of describing programming
as it is now done, I will take you step by step through the historivcal
development of programming methods.
If you do not understand what I am saying, please,I beseach you, please
stop me by asking some questions. Having had the experience of having
several people tell me the next day that they enjoyed my talk but that
they did not understand a word of what I said, having had this experience
I do not want it to happen again.
As I have said, the computer is particularly dumb and it does not
understand ordinary English. In fact the computer only understands a very
primitive langage indeed, the so called machine language, where the
different instructions are sequences of zeros and ones and where one had
to tell the computer where within its memory each number is to be stored
also by specifying a sequences of zeros and ones.
{\bf Some More History}
In the early days we had to learn how to write programs in this way and
there were not even any books that told us how to do it. If you think
that this would be an almost impossible task then you are not alone
because younger progammers who did not live through those days will agree
with you. But this is what we had to do and looking back I marvel at our
perseverance.
Fortunately, this situation was soon simplified, but I am getting ahead of
myself.
As I was saying, we decided to build a computer and we were able to
convince The University to put up \$110,000 for this project. This seemed
to be quite enough but we soon found that it was quite short of the amount
needed. So what to do about the matter. We came up with the bright idea
of building a very simple machine and of getting this machine to perform
something quite spectacular that would convince our board of trustees to
cough up some more money. But what to do?
It happened that there was to be
an International checker match the very next spring in a neighborin town
and someone suggested that we get our small machine to play checkers so
that we could have it play and beat the new world checker champion after
the match, and I was elected to write the program. These was to be for a
machine that had not yet even been designed and whose order structure hav
not been decided on. Not knowing the strings of ones and zeros that were
to be used to represent say add or subtract, I had to write the program in
suymbolic form ussing Add for add Sub for subtract, my for multiply etc.
and to assign names to the locations in memory where different quantities
were to be stored. I did not know it at the time but I had come close to
inventing the next step in programming art.
Needless to say it took us longer to build even this very simple machine
that the time available and longer for me to write this program so that
the match came and went and we settled down for the long hall to build the
kind of machine that we had at first envisioned.
I became dissetisfied with our rate of progress at Illinois where work on the
computer took second place with respect to our teaching responsiilities
and so I left and went to work with IBM in the hopes that they weqould have the resourses
to design an build the kind of computer that we were trying to build
at Illinois.
I found that IBM was indeed working on a computer that was then known as
the defence calculater and I was soon deeply involved in developing
special vacuum tubes and other components for ths new machine.
I still wanted to get the checker program that I had been writing at
Illinois completed and translated into the machine language for this
defense calculator. but before I had gone very far in this direction IBM
had desided to designe and build yet another computer which was later to
be known as the 701, an so I had to start all over again adapting my
program to this newer machine. You can imaging the excitement that I felt
when I learned that one of my coworkers, Nat Rochester, had been working
on this problem of translating a program written in symbollic notation
into machine code and that he was actually proposing to write a computer
program that would do this translation. He called the symbollic language
an assembly language and the program that was to tell the computer how to
effect this translation an assemblier. Getting a man written program to
run on a computer was then to be a two stage process, first you would get
the computer to translate your man written program into machine language
by giving it an assemblier program which unfortunate had to originally
been written directly in machine code, and then the machine could take its
directions from this translated program and produce your desired results.
Is this just too complicated to understand? Shall I give you an example?
The nearest approach to this might be for some one who knew both English
and say Russian to write a book in English that explained in English how
to thanslate a Russian paper into English so that an English speeking
person could produce an English translation of the Russian paper that he
couls subsequently read.
Unfortunately, the very first assembly program itself had to be written
directly in machine code, and I was one of the people who had a hand in
doing this. Having written the very first assembly program, one could
then use it to write more elaborate assembly programs.
During this period, computers were monsterous affairs, employing vacuum
tubes, and costing large sums of money.
The next step in the simplification of computer programming was the
introduction of in what are called higher languages. These carry such
names as Fortran, Algol, and Pascal. These languages all have a common
characteristic in that one higher language instruction usually requires
several machine instructions for its execution. The program that is used
to translate your program into machine language is then called a compiler
and running a program that is written in a higher language is still a two
stage process, the program must first be compiled and then this compiled
program must be executed.
Along with the development of higher languages there came a new
development, that is the creation of so called operating systems. An
operating system is yet another program that resides in the computer at
all times and that greatly simplifies the kinds of things you have to tell
the computer to get it do do many rather standard things. The operating
system transform what would be a quite cranky and diffficult machine into
a rather gentle beast that is quite tolerant and will even tell you when
you make mistakes in instructing it. This operating system is involved in
automatically displaying the text that you type on the TV screen and it
usually automatically evokes quite a number of so-called service routines
that do many commonly needed things for you.
This period saw the introduction of transisters as the control devices
within the computer. This started a trend toward minitursation that has
continued to this day.
More recently a number of so-called interpreters have been written that
will accept certain higher level program languages and do this translation
on the fly as it were. This is an advantage for programs that are to be
run only a few times as only one step is involved but it is a serious
disadvantage for programs that are to be run many times because the
interpretation must be done over again every time the program is run.
Fortunatly certain languages allow both interpretation and compiling.
Basic is one such language much favored by personal computer users.
Along with this development we witnessed the first intriduction of
transistor chips in which many different transistor like devices were
placed on a single chip of silicon, about the size of your little finger
nail. The most recently announced chip has no less that 524,248 different
circuit elements on a single chip.
With the availability of transistor chips, we saw the first of a steady
stream of so-called personal computers. At the present time there are
approxamently 200 different companies making small computers. This has
resulted in the rapid reduction in prices, an advantage to the potential
purchaser. There is a danger however in that not more than perhapse 5 or
msybe ten of these companies can maintain a foothold in this market so
there is a real dander that the unwary purchasor may buy a computer from a
company that is soon to go out of business.
So where does all of this leave us today? Well as a matter of fact the
task of writing programs in these higher languages is still enough of a
task that even computer professionals try to avoid doing it when ever
possible, and as a result, a large number of programs have been written
and offered for sale so that one can almost always find a ready made
program for most of one's needs. So rather that having to learn about
programming one had better spend one's time learning about the
availability of these canned programs.
{\bf How would I Use a Computer}
{\bf How to Get Started}
Your first task, if you are interested in getting a personal computer is
to decide precisely what you want to do. Are you only interested in word
processing of do you want to do some computing? Then you must look into
the availability of programs and on which computerd these programs run and
only then decide on which computer to buy. There is really no sure way to
protect yourself against the danger of your computer becoming an orphan
except perhaps that of buying an IBM computer which naturally costs
considerably more than some of the others,
Of course, if you are only interested in word processing then your task is
somewhat simplified but even here there is a bewildering aray of different
word processors on the market. Some of these provide a minimum amount of
typing assistance over that available with the modern typewriter. Some
word processors provide many conveniences, like the ability to pick up
individual word or phrases or even entire paragraph and to move them
around on the page, from page to page and even from one document to
another. Some will correct your spelling, some do automatic hyprenation,
som havs a serch and substitute command that allow you to replace all
instances where you used a less desirable word or phrase by a better one.
Some allow you to store a vocabulary of frequently used words, phrases
sentences and even whole paragraphs and to assign code words to them so
that you can cause the entire phrase to be typed by typing the code word.
For example if you always sign your business letters with Yours truly
folluwed by your name, you might assign the code /yt to this and
thereafter you need only type /yt to have the desired closing phrase and
your name typed of future letters.
The problem of a choice between the different available prepackaged
programs is even more complicated that one might at first suspect. For
example suppose you want to do your own income tax returns. You can buy a
program that will do everything including typing out the forms themselves.
The problem with this approach is that such a program is rather expensive,
that is, it will cost some hunderds of dollars. Not only that, but you
will have to buy a much better printer than you might otherwise need. So
you decide that this is out. People in the business of doing income tax
returns usually use such programs, but one cannot justify the cost.
The next step down is to get a program that will do all of the necessary
computations and tabulate the results but will not enter then in on the
final form, but even here, there is a rather wide choice of programs. The
cheapest approach is to buy a program specifically geared to do income tax
forms only.
An alternate approach is to buy a program that is somewhat more general
and that will do many so similar things. There are several such programs
available. I happen to have one called Vicacalc. Let me discribe this
program. It is of the class loosely known as a ``spread sheet'' program
and it enables one to type things in columns appearing on your TV screen,
and eventually on a printed output sheet, much as you might list these
figures on a piece of paper. Figure that are to e ntered fromome other
sourcecan then bee typed drectly while th computer can easily be assigned
the task of makng the ncessay calculation to get sums or other functions
of thes entries and type these nto the spread sheet.
For example you might head a column with the word ``Dividents'' and then
below this list the name of the stocks that you own together with the
dollar and cents amount recieved during the year. Below this column you
would write the words ``Total Dividend Income''. But then instead of
adding up the figures yourself you type a commend that tells the computer
to do this and then the total appappears as if by your final form, but
unfortunately it is impractical to hacve them appear on the computer in
exactly th same place on the page as they do on the final form. You
continue in this way and list all of the figures that are required but in
each case where a calculation is envolved, you type an instruction that
tells the computer to do it.
As you work on this spread sheet, you occassionally take time to instruct
the computer to write out the sheet onto a floppy disk so as to retain
your calculation should you have a power failure or should you want to
stop working temporarily.
Now the advantage of doing all of this, asside from the relief from having
to do all of the adding and subtracting yourself, is the ease of make
correction, because one always makes mistakes. If you find that one
figure is in error you move an indicator back to the wrong figure and
simply type in the corrected figure right on top of the original figure.
The computer will automatically recompute the column total and recompute
the the entire form up to and including the final calculation of the
amount that you owe Uncle Sam.
\bye
This is a simple test text. \setbox0=\hbox{foo\vadjust{\vbox{*}}bar} \bye
\setbox1=\copy0 \bye
\def\p#1{\special{point #1}} \def\j#1#2{\special{join 4 #1 #2}}
\tabskip=15pt \halign{&\hfil#\hfil\cr John& Harry& Alexander\cr \p1& \p2&
\p3\cr \noalign{\vskip 30pt} \p4& \p5& \p6\cr Helen& Janet&
Amy\cr}\j15\j24\j36
\bye
\def\a{\b} \def\b{A\def\a{B\def\a{\b}}}
\a\a\a
\a \a \bye %\def\puzzle{\a\a\a\a} %\puzzle
\pagelayout{normal} \documentstyle{article} \begin{document}
\bibitem{knuth-82} Knuth, Donald E. ; The Texbook
This is just a simple sentence to see if LaTeX works. \cite{Knuth-tex82}
\end{document}
*\show\cite > \cite=macro: #1->\if@filesw \immediate \write \@auxout
{\string \citation {#1}}\fi \def \@cit ea {}\@cite {\@for \@citeb :=#1\do
{\@citea \def \@citea {,}\@ifundefined {b@\@c iteb }{{\bf ?}\@warning
{Citation `\@citeb ' on page \co@page \space undefined}} {\csname
b@\@citeb \endcsname }}}. <*> \show\cite ? ↑C ↑C
%\magnification=1200 \font\Z=manfnt \def\META{{\Z METAFONT}}
\def\La{L\kern-.1667em\raise.5ex\hbox{a}\kern-.1em} \def\fl#1{\null\par
\leftline{\bf #1?}} \def\teX{\null\kern1.5pt\TeX}
\def\The{\null\kern1.5pt The} \def\\{{\tt \char'134}} \def\cs{{\sl control
sequence}} \def\css{{\sl control sequences}} \def\Css{{\sl Control
sequences}} \def\lbr{{\tt \char'173}} \def\rbr{{\tt \char'175}}
\def\rrbr{{\tt \char'175\char'175}} \def\und{\tt \char'137} \def\til{\tt
\char'176} \def\sup{\tt \char'136} \parskip 10pt plus 1pt \parindent=0pt
\def\AmSTeX{$\cal A\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em
S$-\TeX} \pageno=1 \font\sixrm=amr6 \font\eightrm=amr8 \font\ninerm=amr9
\font\rmhalf=amr10 scaled \magstephalf \font\rmone=amr10 scaled \magstep1
\font\rmtwo=amr10 scaled \magstep2 \font\rmthree=amr10 scaled \magstep3
\font\rmfour=amr10 scaled \magstep4 \font\rmfive=amr10 scaled \magstep5
\font\bfl=ambx10 scaled \magstep2 \font\amss=amss10 \font\amssi=amssi10
\font\amsltt=amsltt10 \font\amu=amu10 \font\ambi=ambi10
\font\Dunh=amdunh10 \font\amssbx=amssbx10 \font\amcsc=amcsc10
\def\trademark{{\kern-.13em\raise 1ex\hbox{\fiverm \ooalign
{\hfil\kern.03em \raise .09ex\hbox {R}\hfil \crcr \lower
.25ex\hbox{\mathhexbox 20D}}}}} %\rightskip \z@ plus2em \spaceskip .3333em
\xspaceskip .5em . \def\ragcent{\raggedright \leftskip=\rightskip}
\def\ragleft{\leftskip=0pt plus2em \spaceskip.3333em \xspaceskip.5em }
\def\raggedcenter{\leftskip=0pt plus4em \rightskip=\leftskip
\parfillskip=0pt \spaceskip=.3333em \xspaceskip=.5em \pretolerance=9999
\tolerance=9999 \hyphenpenalty=9999 \exhyphenpenalty=9999 }
\def\loterms{\hbox{\rm lower order terms}}
\centerline{\bf \TeX\ Macros Made Easy}
This is a follow-up manual to ``First Grade \TeX\ A Beginner' Manual'' and
it assumes that the reader is reasonably well acquainted with the
rudiments of \TeX, at least to the extent that they are covered in this
earlier manual. In contrast with this earlier manual, where the aim was
to condense much of the more immediately useful part the \TeX's r'e
protare of commands into a thirty-four page text, the present manual is,
if anything, an expansion of the material in Chapter~20 of ``The \TeX
book'', with a liberal sprinkling of ideas culled from Appendix~B and
Appendix~D, all in an attempt to remove most of the mystery that seems to
surround the writing of \TeX\ macros.
Writing \TeX\ macros is really not all that difficult. While the writing
of a complete set of macros, such as those contained in ``The \La\TeX\
Document preparation System'' by Leslie Lamport or in ``The Joy of \TeX''
by Michael Spivak, is not a task to be undertaken lightly, do not dispair.
\TeX's macro facility is not all that difficult to understand, and the
\TeX\ user who has mastered the rudiments of \TeX, as outlined in ``First
Grade \TeX'' is well prepared to go on the task of either writing his own
macros, to suppliment those provided by {\tt PLAIN.TEX} or of hand
tailoring a few macros, lifted from any one of a number of sources, to
better fit his or her own particular needs.
\TeX's macro facility is extremely powerful, so powerful, in fact, that it
is quite intiminating to the novice it appears to involve mysteries that
are quite beyond comprehension.
Much of this apparent mysticism seems to reside in the fact that the
novice is disposed to think that the facility must be quite complicated
when in fact the power of the macro facility resides in the fact that
there are a very few and extremely simple rules which \TeX\ applies in a
very mechanical and rigorous way. So, before getting into the details,
let us see if we cannot state these simple rules in a way that will dispel
this air of mystery and allow you the really understand what it is all
about.
Actually, this power resides in a few extremely simple rules that govern
the way that \TeX\ interprets the macros that it encounters and
We will, however repeat some of the elementary notions relating to macros
in this section. But first, some general remarks about \TeX's macro
First Grade \TeX\ used as an example of a simple macro the definition:
\smallskip \centerline{\tt \\def\\loterms\lbr \\hbox\lbr \\rm lower order
terms\rrbr.} \smallskip Such macros all begin with the control sequence
`{\tt \\def}' followed by the new name and then the meaning to be assigned
to this new name (enclosed in braces that are not a part of the
definition). If braces are wanted as a part of the definition they must
be added.
Having made such a definition, to get: $$x↑3+\loterms \hbox{\qquad you
type \qquad {\tt \$x\↑{}3+\\loterms\$}}$$
The second basic idea refered to in First Grade \TeX\ was the fact that
macros may, and, in fact, very often do, use other macros in their
definitions.
\bye
\def\a{\b} \def\b{A\def\a{B\def\a{\b}}} \a\ Now reverse it. \a\ Now what
is it? \a\ And now what? \a\ \bye \def\puzzle{\a\a\a\a\a\a} \puzzle \bye
\centerline{Introducing \TeX\kern .1em \footnote{\trademark}{\TeX\ is a
trademark of the American Mathematical Society.}} %\ragcent %\ragleft
\teX\ is a computerized typesetting system that is regularly used for
technical papers, business forms, letters, theses, concert programs,
catalogues, and books of all sorts and in particular those that are
technical and highly mathematical. \teX\ was created by Professor Donald
E. Knuth and his associates and students at Stanford University. The
current version, with many new features, has been completely rewritten by
Professor Knuth, after several years of operating experience with the
earlier versions on many different~computer~systems.
\The\ \TeX\ system has been standardized to produce identical results on
different computer systems and it will run on any reasonably large system.
The \TeX\ output files are also device independent. The output may be
printed on a graphics printer of modest capabilities for proofing and,
when the results are satisfactory, the same output may be used with a
higher quality printer or phototypesetting system to produce the final
document.
\fl{How does \TeX\ differ from other document compilers} \TeX\ provides
for automatic ligature replacements, kerning, hyphenation, line
justification, centering, flushing right or left, tabular aligning, the
formatting of complicated mathematical expressions, automatic section and
page numbering, page breaking, the introduction of running heads, the
numbering and placing of footnotes, and the automatic preparation of a
table of contents and an index, to name but a few of its special features.
As many as 256 different fonts with up to 256 characters per font may be
used for a single document. \TeX's real forte is mathematics: $$
\sum_{i=1}↑{\infty}{1\over2↑i}=1,\quad \{\underbrace{\overbrace{\mathstrut
a,\ldots,a} ↑{k\;a\mathchar`'\rm s}, \overbrace{\mathstrut b,\ldots,b}
↑{l\;b\mathchar`'\rm s}}_{k+l\rm\;elements}\},\quad
\sqrt{1+\sqrt{1+\sqrt{1+x}}},\quad A=\pmatrix{ a_{11}&\ldots&a_{1n}\cr
\vdots&\ddots&\vdots\cr a_{m1}&\ldots&a_{mn}\cr}, $$ $$
\biggl(\int_{-\infty}↑\infty e↑{-x↑2}\,dx\biggr)↑2=\pi,\quad
2\uparrow\uparrow k\mathrel{\mathop=↑{\rm def}}
2↑{2↑{2↑{\cdot↑{\cdot↑{\cdot↑2}}}}} \vbox{\hbox{$\Big\}\scriptstyle
k$}\kern0pt},\quad {f(x+\Delta x)-f(x)\over\Delta x}\to f'(x)\;\;\hbox{as
$\;\Delta x\to0$}. $$ \TeX\ differs from other document compilers in that
it performs all of the above functions, while meeting the highest
typographic standards, and at the same time it provides an extremely great
amount of flexibility to allow formatting of a wide range of document
types and styles, subject only to the detailed requirements of the user.
Flexibility is achieved by the use of a comprehensive set of low-level
typographic primitives and by mechanisms that allow these primitives to be
used for the creation of higher-level constructs, called `{\sl macros\/}',
that the user may write, or that come supplied as `{\sl macro
packages\/}'.
\bye
\ddangerexercise Devise a ↑|\raggedcenter| macro (analogous to
↑|\raggedright|) that partitions the words of a paragraph into as few as
possible lines of approximately equal size and centers each individual
line. Hyphenation should be avoided if possible. \answer
|\def\raggedcenter{\leftskip=0pt plus4em \rightskip=\leftskip|%
\parbreak|\parfillskip=0pt \spaceskip=.3333em \xspaceskip=.5em|\parbreak
|\pretolerance=9999 \tolerance=9999|\parbreak |\hyphenpenalty=9999
\exhyphenpenalty=9999 }|
\font\sll=amsl9
\centerline{\fiverm\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX }\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX }\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
{\rmfour\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
{\rmfour\TeX{\rmfive\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
{\rmfour\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX }\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX{\rmhalf\TeX }\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm
\TeX{\rm\TeX }\TeX}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX {\ninerm \TeX
}\TeX}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
}\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX}\TeX}\TeX}
\centerline{\fiverm\TeX{\sixrm\TeX}\TeX}
\centerline{\fiverm\TeX}
\bye